#include<stdio.h>
int main()
{
	int n=0,a,b,score=-160;
	scanf("%d",&n);
	for(int i=0; i<n; i++)
	{
		scanf("%d %d",&a,&b);
		if(a==0)
		{
			if(b==1)  score+=10;
			else if(b==-1)  score-=10;
		}
		else if(a<0)
		{
			if(b==1)   score+=15;
			else if(b==-1)  score-=5;
		}
		else if(a>0)
		{
			if(b==1)  score+=5;
			else if(b==-1) score-=15;
		}
	}
	printf("%d",score);
	return 0;
}
